#ifndef RP2SKINNINGEFFECT_H
#define RP2SKINNINGEFFECT_H

#include "Rp2ShaderEffect.h"
#include "Rp2LightingMaterialEffect.h"
#include "Rp2Skeleton.h"

namespace Rp2
{
	
class SkinningEffect : public LightingMaterialEffect
{
	RP2_DECLARE_RTTI;
	RP2_DECLARE_NAME_ID;

public:
	SkinningEffect(const std::string& rkTextureName);
	virtual ~SkinningEffect();

	// member access
	Skeleton* GetSkeleton();
	void SetSkeleton(Skeleton* pkSkeleton);
	std::vector<Bone*>& GetBones();	
	int GetBonesQuantity();

	void SetMatrix(int i, const float* afMatrix);
	const Matrix4f& GetMatrix(int i) const;

	// update skeleton animation
	void Update();

	// set shader effect
	virtual void Configure();
protected:

	// skeleton animation
	Skeleton* m_pkSkeleton;
	
	float m_akMatrix[24][12];
};

typedef Pointer<SkinningEffect> SkinningEffectPtr;

#include "Rp2SkinningEffect.inl"

}

#endif